import 'package:json_annotation/json_annotation.dart';

import 'action_type.dart';
import 'action_type_converter.dart';

part 'message.g.dart';

@JsonSerializable(
  explicitToJson: true,
  anyMap: true,
  converters: [ActionTypeConverter()],
)
class Message {
  final String content;
  final String timestamp;
  final ActionType? actionType;

  Message({required this.content, required this.timestamp, this.actionType});

  factory Message.fromJson(Map<String, dynamic> json) =>
      _$MessageFromJson(json);

  Map<String, dynamic> toJson() => _$MessageToJson(this);
}


